package com.yimingkeji.mysql.entity;

import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import java.util.Date;

/**
 * @Describe:
 * @Auther: zhenlong.yang
 * @Date: 2018/12/1 20:38
 */
@Data
@Entity(name = "user")
public class User {
    @Id
    private int id;

    private String name;

    private int age;

    @Column(name = "phone_number", unique = true)
    private String phoneNumber;

    private boolean available;

    @Column(name = "create_time")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime = new Date();
}
